package logger

import (
	"fmt"
	"io"
	"log"
	"os"
	"runtime"
	"sync"
	"time"
	"path/filepath"
)
// Settings stores config for logger
type Setting struct {
	Path 	string `yaml:"path"`
	Name 	string `yaml:"name"`
	Ext 	string 	`yaml:"ext`
	TimeFormat string `yaml:"time-format"`
}

var (
	logFile 	*os.File
	defaultPrefix = ""
	defaultCallerDepth = 2
	logger *log.Logger
	mu 		sync.Mutex
	logPrefix = ""
	levelFlags = []string{"DEBUG","INFO","WARN","ERROR","FATAL"}
)

type logLevel int

const (
	DEBUG logLevel = iota
	INFO
	WARNING
	ERROR
	FATAL
)

const flags = log.LstdFlags

func init() {
	logger = log.New(os.Stdout,defaultPrefix,flags)
}

func Setup(setting *Setting) {

}

func setPrefix(level logLevel) {
	_, file, line , ok := runtime.Caller(defaultCallerDepth)
}